package com.huawei.appmarket.service.alarm;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol.Request;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.secure.android.common.intent.SafeIntent;
import o.cii;
import o.cjk;
import o.cjm;
import o.cjo;
import o.Logger;
import o.dpk;

public class ProSurvivalMessageDealReceiver extends BroadcastReceiver {
    public static final String PUSH_MESSAGE_DETAILID = "PushMessageDetailId";
    public static final String PUSH_MESSAGE_MSGID = "PushMessageMsgId";

    public void onReceive(Context context, Intent intent) {
        SafeIntent safeIntent = new SafeIntent(intent);
        String stringExtra = safeIntent.getStringExtra(PUSH_MESSAGE_MSGID);
        String stringExtra2 = safeIntent.getStringExtra(PUSH_MESSAGE_DETAILID);
        Logger.ˏ("ProMsgDealReceiver", "detailId = " + stringExtra2);
        if (stringExtra == null || stringExtra2 == null) {
            Logger.ˋ("ProMsgDealReceiver", "message is empty!");
            return;
        }
        ˏ(context, stringExtra, stringExtra2.replaceAll("\\|", "#$#"));
        ˏ(context, stringExtra2);
    }

    private void ˏ(Context context, String str, String str2) {
        new dpk(str, str2).onEventNotifyClick(context);
    }

    private void ˏ(Context context, String str) {
        BaseCardBean baseCardBean = new BaseCardBean();
        baseCardBean.ॱ(str);
        if (!cii.ˊ().ˊ(context, baseCardBean)) {
            cjo appDetailActivityProtocol = new AppDetailActivityProtocol();
            appDetailActivityProtocol.ˏ(new Request(str, null));
            cjm o_cjm = new cjm("appdetail.activity", appDetailActivityProtocol);
            o_cjm.ॱ(context).addFlags(268435456);
            cjk.ˎ().ˋ(context, o_cjm);
        }
    }
}
